package nanocast.apps.creator.modules.sceneListModule 
{
	import org.puremvc.as3.multicore.patterns.facade.Facade;
	import nanocast.apps.creator.modules.sceneListModule.controller.StartupCommand;
	
		
	
	public class ApplicationFacade extends Facade 
	{	
		//application
		public static const STARTUP:String = "startup";
		public static const SHUTDOWN:String = "shutdown";
		
		
		// proxy
        public static const LOADING_STEP:String				= "loadingStep";
        public static const LOADING_COMPLETE:String			= "loadingComplete";
		public static const LOAD_CONFIG_FAILED:String		= "loadConfigFailed";
        public static const LOAD_RESOURCE_FAILED:String		= "loadResourceFailed";
		
		// command
        public static const COMMAND_STARTUP_MONITOR:String	= "StartupMonitorCommand";
		
		//view
		public static const SHOW_SCENE_LIST:String		= "showSceneList";
		
		// common messages
		public static const ERROR_LOAD_FILE:String			= "Could Not Load the File!";
		
		
		
		public function ApplicationFacade(key:String)
		{
			super(key);
		}
		
		
		public static function getInstance(key:String) : ApplicationFacade
		{
			 if ( instanceMap[ key ] == null ) instanceMap[ key ] = new ApplicationFacade(key);
			return instanceMap[ key ] as ApplicationFacade;
		}
		
		override protected function initializeController():void
		{
			super.initializeController();
			registerCommand(STARTUP, StartupCommand);
		}
		
		public function startup(app : SceneList) : void 
		{
			sendNotification(STARTUP, app);
		}
	}
}